Skip to content

[Feature] Add Slipstream Plugin Support#4175

Open
dgrkotsonis wants to merge 32 commits intostagingfrom
add_slipstream_plugin_support
Open

[Feature] Add Slipstream Plugin Support#4175
dgrkotsonis wants to merge 32 commits intostagingfrom
add_slipstream_plugin_support

Conversation

@dgrkotsonis
Copy link
Copy Markdown
Collaborator

@dgrkotsonis dgrkotsonis commented Mar 17, 2026

Summary

Wires the new Slipstream plugin system into snarkOS so that node operators can load one or more streaming plugins at startup and manage them at runtime via authenticated REST endpoints. Validator and Client nodes both support plugins; Prover nodes do not (they do not finalize blocks).


Changes

Cargo / feature wiring

  • All Slipstream functionality is gated behind --features slipstream-plugins. Nodes compiled without the feature are unaffected. The flag propagates through the workspace: snarkos → snarkos-cli → snarkos-node → snarkos-node-rest → snarkvm.
  • Cargo.toml — Added snarkvm-slipstream-plugin-manager as a new workspace dependency
  • node/Cargo.toml — Added snarkvm-slipstream-plugin-manager as an optional dep, propagate new slipstream-plugins feature flag to enable it alongside the corresponding snarkvm features.
  • node/rest/Cargo.toml — Same optional dep + feature wiring.
  • cli/Cargo.toml — Added slipstream-plugins features forwarding to snarkos-node.

CLI

  • cli/src/commands/start.rs — Added --slipstream-config PATH flag (repeatable; feature-gated). Empty slice is passed when the feature is disabled so the call site is always uniform.

Node layer

  • node/src/node.rs — Threaded slipstream_configs: &[PathBuf] through new_validator and new_client.
  • node/src/validator/mod.rs / node/src/client/mod.rs — After Ledger::load, if plugin configs are provided, a SlipstreamPluginManager is initialized and injected into the FinalizeStore

REST API

  • node/rest/src/lib.rs — Registered three slipstream routes. Added DELETE to CORS allowed methods.
  • node/rest/src/routes.rs — Implemented three handlers:
Method Path Description
GET /{network}/slipstream/plugins List loaded plugins
POST /{network}/slipstream/plugins Load a plugin from a config file
DELETE /{network}/slipstream/plugins/{name} Unload a plugin by name

PUT (reload) is not yet implemented and is left as a TODO.

Error mapping: PluginNotLoaded → 404, PluginAlreadyLoaded → 422, all others → 500.

Tests / docs

  • node/tests/common/node.rs — Updated client() and validator() test helpers to pass &[] for the new parameter.
  • docs/slipstream_plugins.md — New operator guide covering: what Slipstream is, plugin ABI and build instructions, JSON5 config format, startup flags, full REST API reference, and curl examples. (NOTE: Couldn't think of a better place to put it so happy to move elsewhere)

Usage

Build with plugin support

cargo build --release --features slipstream-plugins

Start a client node with two plugins

snarkos start --client \
--slipstream-config ~/.aleo/plugins/postgres/plugin.json5 \
--slipstream-config ~/.aleo/plugins/metrics/plugin.json5

List loaded plugins

curl http://localhost:3030/mainnet/slipstream/plugins

Load a new plugin at runtime

curl -X POST -H "Content-Type: application/json" \
-d '{"config_file":"/path/to/plugin.json5"}' \
http://localhost:3030/mainnet/slipstream/plugins

Delete/Unload a new plugin at runtime

curl -X DELETE \
http://localhost:3030/mainnet/slipstream/plugins/{plugin_name}


Notes

  • All plugin-related code is gated on #[cfg(feature = "slipstream-plugins")], so builds without these features are unaffected.
  • Plugin manager lock errors (poisoned RwLock) surface as 500 errors; plugin call errors during finalize are logged as warnings and never propagated to the node.

@dgrkotsonis dgrkotsonis marked this pull request as draft March 17, 2026 22:19
Comment thread node/rest/src/lib.rs Outdated
@@ -0,0 +1,198 @@
# Slipstream Plugins
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a better place to put this file rather than creating this new docs dir? (Unlike snarkVM there isn't a specific plugins crate to put this in)

@dgrkotsonis dgrkotsonis force-pushed the add_slipstream_plugin_support branch from 289408f to ec83f3f Compare April 22, 2026 14:57
@dgrkotsonis dgrkotsonis marked this pull request as ready for review April 22, 2026 17:43
@dgrkotsonis dgrkotsonis changed the title [Feature/Draft] Add Slipstream Plugin Support [Feature] Add Slipstream Plugin Support Apr 22, 2026
Comment thread node/rest/src/lib.rs
Comment on lines +272 to +279
#[cfg(feature = "slipstream-plugins")]
let routes = routes
.route("/slipstream/plugins", get(Self::slipstream_list_plugins).post(Self::slipstream_load_plugin))
.route(
"/slipstream/plugins/{name}",
// TODO: PUT (reload) is not yet implemented.
axum::routing::delete(Self::slipstream_unload_plugin),
);
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to put these behind the auth middleware? Could foresee this being a potential issue if in theory anyone is able to hit a node and unload plugins

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes good idea

@vicsn vicsn requested a review from ljedrz May 1, 2026 06:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants